<!DOCTYPE html>
<html style="height:100%">
	<head lang="zh-CN">
		<meta charset="<?php bloginfo( 'charset' ); ?>">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv=”Cache-Control” content=”no-transform” />
	    <meta http-equiv=”Cache-Control” content=”no-siteapp” />
        <?php 
            if(!is_bbpress() || bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_topic_tag() || bbp_is_topic_tag_edit()|| bbp_is_single_reply()){
                Header("HTTP/1.1 303 See Other");
                Header("Location: ".esc_url( home_url( '/' ))."?forum=主版块"); 
            }
        ?>
		<?php
			wp_head(); 
		?>
		<style type="text/css" media="screen">
			html{
				margin-top: 0px !important;
			}
		</style>
	</head>
    <body style="height:100%;width:100%">
		<!--顶部导航-->
		<nav class="navbar navbar-inverse" style="position: absolute;z-index: 1;width: 100%;" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-collapse">
		         <span class="sr-only">切换导航</span>
		         <span class="icon-bar"></span>
		         <span class="icon-bar"></span>
		         <span class="icon-bar"></span>
		      </button>
				<a href="<?php echo esc_url( home_url( '/' )); ?>"><img src="<?php echo get_template_directory_uri() ?>/img/logo.gif" class="logo pull-left" /></a><a class="navbar-brand purl" href="<?php echo esc_url( home_url( '/' )); ?>">转运虎<span class="url">zhuanyunhu.com</span></a>
			</div>
			<!--网站导航-->
			<div class="collapse navbar-collapse pull-left" id="example-navbar-collapse">
					<?php
					 // 主菜单
                    wp_nav_menu( array(
                        'menu_class'     => 'nav navbar-nav',
                        'theme_location' => 'top_left'
                    ));
					?>
			</div>
			<?php if(!is_user_logged_in()) : ?>
			<!--登录表单-->
			<div class="navbar-form navbar-left navbar-right">
         		<a type="button" class="btn btn-default" href="<?php echo site_url().'/wp-login.php' ?>">登录</a>
         		<a type="button" class="btn btn-default" href="<?php echo site_url().'/wp-login.php?action=register' ?>">注册</a>
      		</div>
			<?php else : 
				$current_user = wp_get_current_user();
			?>
			<div class="navbar-right">
				<ul class="nav navbar-nav" role="tablist">
					<li role="presentation" class="dropdown">
						<a class="dropdown-toggle" data-toggle="dropdown" href="#">
						<?php echo get_avatar($current_user->ID,15) ?>
						<?php echo $current_user->display_name ?><span class="caret"></span>
						</a>
						<ul class="dropdown-menu" role="menu">
							<?php if(current_user_can('level_10')):?><li role="presentation"><a role="menuitem" tabindex="-1" href="<?php echo home_url().'/wp-admin/'; ?>">后台</a></li><?php endif; ?>
							<li role="presentation"><a role="menuitem" tabindex="-1" href="<?php echo home_url().'/?bbp_user='.get_the_author_meta('ID'); ?>">个人中心</a></li>
							<li role="presentation"><a role="menuitem" tabindex="-1" href="<?php echo wp_logout_url(); ?>">登出</a></li>
						</ul>
					</li>
				</ul>
			</div>
			<?php endif; ?>
			</div>
		</nav>